home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / RIncludes / Cmdo.r < prev    next >
Encoding:
Text File  |  1993-11-30  |  13.3 KB  |  389 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Cmdo.r
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. */
  11.  
  12.  
  13.  
  14. #ifndef __CMDO_R__
  15. #define __CMDO_R__
  16.  
  17. #define    FilesID                        0
  18. #define    MultiFilesID                1
  19. #define    CheckOptionID                2
  20. #define    RadioButtonsID                3
  21. #define    RegularEntryID                4
  22. #define    MultiRegularEntryID            5
  23. #define    BoxID                        6
  24. #define    TextBoxID                    7
  25. #define    PopUpID                        8
  26. #define    NestedDialogID                9
  27. #define    TextTitleID                    10
  28. #define    RedirectionID                11
  29. #define    EditPopUpID                    12
  30. #define    TriStateButtonsID            13
  31. #define    ListID                        14
  32. #define    PictOrIconID                15
  33. #define    DummyID                        16
  34. #define    DoItButtonID                17
  35. #define    VersionDialogID                18
  36.  
  37. #define    CMDOVersion                    8
  38.  
  39. /*        The following are used to set styles, simply add for desired style.
  40. */
  41. #define bold            1
  42. #define italic            2
  43. #define underline        4
  44. #define outline         8
  45. #define shadow            16
  46. #define condense        32
  47. #define extend            64
  48.  
  49. type 'cmdo' {
  50.   integer = CMDOVersion;                                    /* Version number */
  51.   integer = $$CountOf(dialogs);                                /* # of dialogs, at least 1 */
  52.   array dialogs {
  53.     integer;                                                /* height of the dialog */
  54.     cstring;                                                /* text displayed in help window */
  55.     align word;
  56.  
  57.     integer = $$CountOf(itemArray);                            /* # of items */
  58.     
  59.     /* The order in which Commando writes out the options is the same order in which the
  60.        items in this array are entered in your resource declaration.  This is important
  61.        for those commands which have position dependent parameters. */
  62.        
  63.     wide array itemArray {
  64.         switch {
  65.             case NotDependent:
  66.                 key int = 0;
  67.             
  68.             case Or:
  69.                 key byte = 1;
  70.                 byte = $$CountOf(OrArray);
  71.                 wide array OrArray {
  72.                     int;                                    /* item number dependent upon */
  73.                 };
  74.             
  75.             case And:
  76.                 key byte = 2;
  77.                 byte = $$CountOf(AndArray);
  78.                 wide array AndArray {
  79.                     int;                                    /* item number dependent upon */
  80.                 };
  81.         };
  82.         switch {
  83.             case Files:
  84.                 key byte = FilesID;
  85.                 byte    InputFile,                            /* These types require the  */
  86.                         InputFileOrDir,                        /* 'Additional' case below. */
  87.                         InputOrOutputFile,
  88.                         InputOrOutputOrDir,
  89.                         
  90.                         OutputFile,                            /* These types require the  */
  91.                         OutputFileOrDir,                    /* 'NoMore' case below.     */
  92.                         DirOnly;
  93.                 switch {
  94.                     case OptionalFile:
  95.                         /* Using this case makes a popup with two or three items.
  96.                            This first item is used to select a default file or to
  97.                            select no file.  The second (and third) item(s) are used
  98.                            to select input or output files. */
  99.                         key int = 0;
  100.                         rect;                                /* bounds of title */
  101.                         rect;                                /* bounds of display box */
  102.                         cstring;                            /* title */
  103.                         cstring;                            /* default file */
  104.                         cstring;                            /* option to return before file */
  105.                         cstring;                            /* If this item is dependent upon
  106.                                                                another Files item, an extension
  107.                                                                can be specified here to be added
  108.                                                                to the dependents file. */
  109.                         cstring;                            /* help text for popup */
  110.                         byte        dim, dontDim;            /* Normally, dependent items are
  111.                                                                dimmed if the parent is disabled,
  112.                                                                if this field is "dontDim", then
  113.                                                                this item won't be dimmed */
  114.                         /* These next three strings are the strings displayed in the popup.  Most
  115.                            of the file types have only two strings but InputOrOutputFile and 
  116.                            InputOrOutputOrDir require three strings.  If a string is set to "",
  117.                            Commando will use a built-in default. */
  118.                         cstring;                            /* popup item #1 */
  119.                         cstring;                            /* popup item #2 */
  120.                         cstring;                            /* popup item #3 */
  121.                 
  122.                     case RequiredFile:
  123.                         /* Using this case makes a button that goes directly to standard
  124.                            file.  Use this case when a file is required and the user doesn't
  125.                            have the choice of a default file or no file. */
  126.                         key int = 1;
  127.                         rect;                                /* bounds of button */
  128.                         cstring;                            /* title of button */
  129.                         cstring;                            /* option to return before file */
  130.                         cstring;                            /* help text for button */
  131.                 };
  132.                 
  133.                 /* Some file types take additional information.  See the comment next to the
  134.                    file types to find out which case to choose here. */
  135.                 switch {
  136.                     case Additional:
  137.                         key    byte = 0;
  138.                         cstring;                                    /* For InputOrOutputFile, an option
  139.                                                                        can be specified when a new
  140.                                                                        (or output) file is chosen. */
  141.                         cstring    FilterTypes = ":";                    /* preferred file extension (i.e. ".c") 
  142.                                                                        If null, no radio buttons will be
  143.                                                                        displayed.  If FilterTypes is used,
  144.                                                                        the radio buttons will toggle
  145.                                                                        between showing files only with
  146.                                                                        the types below and all files */
  147.                         cstring;                                    /* title of only files button */
  148.                         cstring;                                    /* title of all files button */
  149.                         byte = $$CountOf(TypesArray);                /* up to 4 types may be specified */
  150.                         align word;
  151.                         array TypesArray {
  152.                             literal longint        text = 'TEXT',        /* desired input file type, specify */
  153.                                                 obj  = 'OBJ ',        /* no type for all types */
  154.                                                 appl = 'APPL',
  155.                                                 da   = 'DFIL',
  156.                                                 tool = 'MPST';
  157.                         };
  158.  
  159.                     case NoMore:
  160.                         key    byte = 1;
  161.                 };
  162.  
  163.             case MultiFiles:
  164.                 key byte = MultiFilesID;
  165.                 cstring;                                    /* button title */
  166.                 cstring;                                    /* help text for button */
  167.                 align word;
  168.                 rect;                                        /* bounds of button */
  169.                 cstring;                                    /* message like " Source files to compile: " */
  170.                 cstring;                                    /* option returned before each 
  171.                                                                filename. Can be null */
  172.                 switch {
  173.                     case MultiInputFiles:
  174.                         key byte = 0;
  175.                         byte = $$CountOf(MultiTypesArray);            /* up to 4 types may be specified */
  176.                         align word;
  177.                         array MultiTypesArray {
  178.                             literal longint        text = 'TEXT',        /* desired input file type, specify no type */
  179.                                                 obj  = 'OBJ ',        /* for all types */
  180.                                                 appl = 'APPL',
  181.                                                 da   = 'DFIL',
  182.                                                 tool = 'MPST';
  183.                         };
  184.                         cstring    FilterTypes = ":";                    /* preferred file extension (i.e. ".c") 
  185.                                                                        If null, no radio buttons will be
  186.                                                                        displayed.  If FilterTypes is used,
  187.                                                                        the radio buttons will toggle
  188.                                                                        between showing files only with
  189.                                                                        the types below and all files */
  190.                         cstring;                                    /* title of only files button */
  191.                         cstring;                                    /* title of all files button */
  192.             
  193.                     case MultiDirs:
  194.                         key byte = 1;
  195.  
  196.                     case MultiInputFilesAndDirs:
  197.                         key byte = 2;
  198.  
  199.                     case MultiOutputFiles:
  200.                         key byte = 3;
  201.                 };
  202.  
  203.             case CheckOption:
  204.                 key byte = CheckOptionID;
  205.                 byte    NotSet, Set;                        /* whether button is set or not */
  206.                 rect;                                        /* bounds */
  207.                 cstring;                                    /* title */
  208.                 cstring;                                    /* option returned */
  209.                 cstring;                                    /* help text for button */
  210.             
  211.             case RadioButtons:
  212.                 key byte = RadioButtonsID;
  213.                 byte = $$CountOf(radioArray);                /* # of buttons */
  214.                 wide array radioArray {
  215.                     rect;                                    /* bounds */
  216.                     cstring;                                /* title */
  217.                     cstring;                                /* option returned */
  218.                     byte    NotSet, Set;                    /* whether button is set or not */
  219.                     cstring;                                /* help text for button */
  220.                     align word;
  221.                 };
  222.             
  223.             case RegularEntry:
  224.                 key byte = RegularEntryID;
  225.                 cstring;                                    /* title */
  226.                 align word;
  227.                 rect;                                        /* bounds of title */
  228.                 rect;                                        /* bounds of input box */
  229.                 cstring;                                    /* default value */
  230.                 byte        ignoreCase, keepCase;            /* the default value is never displayed
  231.                                                                in the commando window.  If what the
  232.                                                                user types in the textedit window
  233.                                                                matches the default value, then that
  234.                                                                value isn't displayed.  This flag
  235.                                                                tells Commando whether to ignore case
  236.                                                                when comparing the contents of the textedit
  237.                                                                window with the default value. */
  238.                 cstring;                                    /* option returned */
  239.                 cstring;                                    /* help text for entry */
  240.  
  241.             case MultiRegularEntry:    /* For scrollable, lists of an option */
  242.                 key byte = MultiRegularEntryID;
  243.                 cstring;                                    /* title */
  244.                 align word;
  245.                 rect;                                        /* bounds of title */
  246.                 rect;                                        /* bounds of input list */
  247.                 byte = $$CountOf(DefEntryList);
  248.                 array DefEntryList {
  249.                     cstring;                                /* default values */
  250.                 };
  251.                 cstring;                                    /* option returned. Each value
  252.                                                                will be preceded with this
  253.                                                                option */
  254.                 cstring;                                    /* help text for entry */
  255.  
  256.             case Box:        /* Can be used to draw lines too */
  257.                 key byte = BoxID;
  258.                 byte            black, gray;                /* color of object */
  259.                 rect;                                        /* bounds of box or line */
  260.                 
  261.             case TextBox:    /* Draws a box with title in upper-left */
  262.                 key byte = TextBoxID;
  263.                 byte            black, gray;                /* color of object */
  264.                 rect;                                        /* bounds of box or line */
  265.                 cstring;                                    /* title */
  266.                 
  267.             case TextTitle:
  268.                 key byte = TextTitleID;
  269.                 byte        plain;                            /* style of text */            
  270.                 rect;                                        /* bounds of title */
  271.                 int            systemFont;                        /* font number to use */
  272.                 int            systemSize;                        /* font size to use */
  273.                 cstring;                                    /* the text to display */
  274.             
  275.             case PopUp:
  276.                 key byte = PopUpID;
  277.                 byte        Window, Alias, Font, Set;        /* popup type */
  278.                 rect;                                        /* bounds of title */
  279.                 rect;                                        /* bounds of popup line */
  280.                 cstring;                                    /* title */
  281.                 cstring;                                    /* option returned */
  282.                 cstring;                                    /* help text for popup */
  283.                 byte        noDefault, hasDefault;            /* hasDefault if first item is "Default Value" */
  284.  
  285.             case EditPopUp:
  286.                 key byte = EditPopUpID;
  287.                 /* For MenuItem, this EditPopUp must be dependent upon another EditPopUp
  288.                    of the MenuTitle type so that the control knows whose menu items to
  289.                    display.
  290.                    
  291.                    For FontSize, this EditPopUp must be dependent upon a PopUp of the
  292.                    Font type so that the control knows what sizes of the font exist. */
  293.                    
  294.                 byte     MenuTitle, MenuItem,                /* Type of editable pop-up */
  295.                         FontSize, Alias, Set;
  296.                 rect;                                        /* bounds of title */
  297.                 rect;                                        /* bounds of text edit area */
  298.                 cstring;                                    /* title */
  299.                 cstring;                                    /* option to return */
  300.                 cstring;                                    /* help text for textedit part */
  301.                 cstring;                                    /* help text for popup part */
  302.                 
  303.             case NestedDialog:
  304.                 key    byte = NestedDialogID;
  305.                 byte;                                        /* the number of the dialog
  306.                                                                to call.  It must be greater
  307.                                                                than the current dialog */
  308.                 rect;                                        /* bounds of button */
  309.                 cstring;                                    /* button's title */
  310.                 cstring;                                    /* help text for button */
  311.             
  312.             case Redirection:
  313.                 key byte = RedirectionID;
  314.                 byte    StandardOutput, DiagnosticOutput,    /* the type of redirection */
  315.                         StandardInput;
  316.                 point;                                        /* upper-left point of the whole contraption */
  317.  
  318.             case TriStateButtons:
  319.                 key byte = TriStateButtonsID;
  320.                 byte = $$CountOf(threeStateArray);            /* # of buttons */
  321.                 cstring;                                    /* option returned */
  322.                 wide array threeStateArray {
  323.                     align word;
  324.                     rect;                                    /* bounds */
  325.                     cstring;                                /* title */
  326.                     cstring;                                /* string for Clear state */
  327.                     cstring;                                /* string for DontTouch state */
  328.                     cstring;                                /* string for Set state */
  329.                     cstring;                                /* help text for button */
  330.                 };
  331.  
  332.             case List:        /* Puts up a list of "things" and allows multiple selections */
  333.                 key byte = ListID;
  334.                 byte        Volumes, ShellVars,
  335.                             Windows, Aliases;                /* what to display in the list */
  336.                 cstring;                                    /* option to return before each "thing" */
  337.                 cstring;                                    /* title */
  338.                 align word;
  339.                 rect;                                        /* bounds of title */
  340.                 rect;                                        /* bounds of list selection box */
  341.                 cstring;                                    /* help text for selection box */
  342.  
  343.             case PictOrIcon:
  344.                 key byte = PictOrIconID;
  345.                 byte    Icon, Picture;                        /* display a picture or icon */
  346.                 int;                                        /* resource id of icon/picture */
  347.                 rect;                                        /* display bounds */
  348.  
  349.             case Dummy:
  350.                 key byte = DummyID;
  351.  
  352.             case DoItButton:                                /* Allows the 'do it' button to be dependent */
  353.                 key byte = DoItButtonID;
  354.  
  355.             case VersionDialog:                                /* Display a dialog when the version # is clicked */
  356.                 key byte = VersionDialogID;
  357.                 switch {
  358.                     case VersionString:                        /* Version string embedded right here */
  359.                         key byte = 0;
  360.                         cstring;                            /* Version string of tool (e.g. V2.0) */
  361.                     
  362.                     case VersionResource:                    /* Versions string comes from another resource */
  363.                         key byte = 1;
  364.                         literal longint;                    /* resource type of pascal string containing version string */
  365.                         integer;                            /* resource id of version string */
  366.                 };
  367.                 cstring;                                    /* Version text for help window */
  368.                 align word;
  369.                 integer        noDialog;                        /* Rsrc id of 'DLOG' */
  370.                     /* NOTE •1: if there is no modal dialog to display when the version
  371.                        string is clicked, set the rsrc id to zero (noDialog).
  372.  
  373.                        NOTE •2: if the version string comes from another resource (VersionResource),
  374.                        the string must be the first thing in the resource and the string must be 
  375.                        a pascal-style string.  A 'STR ' resource is an example of a resource that
  376.                        fits the bill.
  377.                        
  378.                        NOTE •3: if the modal dialog is to have a filter proc, the proc
  379.                        must be linked as a 'fltr' resource with the same resource id
  380.                        as the dialog. */
  381.         };
  382.         align word;
  383.     };
  384.     align word;
  385.   };
  386. };
  387.  
  388. #endif __CMDO_R__
  389.